<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/testTpl1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>TestPage</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    <link rel="stylesheet" type="text/css" href="../style/google/KitchenSink.css">
    <!-- InstanceBeginEditable name="additionalStyle" -->
    <!-- InstanceEndEditable -->

    <script type="text/javascript">
    var djConfig = {
        isDebug: true
        ,debugAtAllCosts: true
    };
    </script>

    <script type="text/javascript" src="../../../trimpath/template-1.0.38.js"></script>
    <script type="text/javascript" src="../../../dojo/deploy/dojo.js"></script>
    <script type="text/javascript" src="../../dojo-lotex.js"></script>

    <!-- InstanceBeginEditable name="dojoRequire" -->

    <script type="text/javascript">
    dojo.require("dojo.widget.*");
    dojo.require("dojo.widget.Dialog");
    dojo.require("lotex.widget.Dialog");
    dojo.require("dojo.html.selection");
    dojo.require("dojo.widget.Editor2");
    dojo.hostenv.writeIncludes();
    </script>

    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="headScript" -->

    <script type="text/javascript">
var tagDlg;

function init(e) {
    tagDlg = dojo.widget.byId("tagDialog");
}
dojo.addOnLoad(init);

function getSel() {
    return dojo.html.selection.getSelectedText();
}

function tagthis() {
dojo.byId("tagtext").value=getSel();
    tagDlg.show();
}
    </script>

    <!-- InstanceEndEditable -->
</head>
<body>
    <table style="width: 100%" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="vertical-align: top" align="left">
                    <div class="ks-Info">
                        Testpage</div>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top" align="left">
                    <table class="ks-Sink" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td style="vertical-align: top; width: 100%; height: 100%" align="left">
                                    <div id="container">
                                        <!-- InstanceBeginEditable name="htmlContainer" -->
                                        <input accesskey="s" type="button" name="Submit" value="tag this" onclick="tagthis();" />
    <div id="storageValueContainer">
        <div id="storageValue" dojoType="Editor2" minHeight="10em" focusOnLoad="true">
        Click <input accesskey="s" type="button" name="Submit" value="tag this" onclick="tagthis();" /> to Begin Editing
        </div>
    </div>

<div dojoType="lotex:dialog" id="tagDialog" bgColor="white" bgOpacity="0.5" toggle="fade" toggleDuration="250" closeNode="hider" title="添加文档条目" style="width:760px;">
    <form onsubmit="return false;">
        <table width="720">
            <tr>
                <td valign="top" nowrap="nowrap">文档条目:</td>
                <td><textarea id="tagtext" name="tagtext" cols="72" rows="8"></textarea></td>
            </tr>
            <tr>
                <td valign="top">关键字:</td>
                <td><input id="tags" name="tags" type="text" size="72">
                  <br />
                  (多个关键字以空格隔开)</td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="button" id="hider" value="OK"></td>
            </tr>
        </table>
    </form>
</div>
                                        <!-- InstanceEndEditable -->                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <fieldset>
        <legend>Output</legend>
        <div id="debug.output">
        </div>
    </fieldset>
</body>
<!-- InstanceEnd --></html>
